IF  EXISTS (SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[dbo].[FK_SrvrInstncDatabaseMSSQL_SrvrInstncDatabase]') AND parent_object_id = OBJECT_ID(N'[dbo].[SrvrInstncDatabaseMSSQL]'))
BEGIN
     ALTER TABLE [dbo].[SrvrInstncDatabaseMSSQL] DROP CONSTRAINT [FK_SrvrInstncDatabaseMSSQL_SrvrInstncDatabase]
END
GO

ALTER TABLE [dbo].[SrvrInstncDatabaseMSSQL] WITH CHECK ADD CONSTRAINT [FK_SrvrInstncDatabaseMSSQL_SrvrInstncDatabase] 
     FOREIGN KEY([SrvrInstncDatabaseId]) REFERENCES [dbo].[SrvrInstncDatabase] ([SrvrInstncDatabaseId])
GO
